﻿#ifndef BUTTERFLY_H
#define BUTTERFLY_H

#include <QWidget>
#include <QPixmap>
#include <QPoint>
class Butterfly : public QWidget
{
    Q_OBJECT
public:
    explicit Butterfly(QWidget *parent = nullptr);
    void fly(int min = 10,int max = 30);
protected:
    void paintEvent(QPaintEvent *event) override;
    void timerEvent(QTimerEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void enterEvent(QEvent *event) override;
signals:

private:
    QPixmap m_pixmap;
    bool m_start = true;
    QPoint m_point;
};

#endif // BUTTERFLY_H
